#ifndef SETTINGSDIALOG_H
#define SETTINGSDIALOG_H

#include <QtGui/QDialog>
#include <QTreeWidget>
#include <QDomText>
#include <QFile>
#include <QTextStream>
#include <QFileDialog>
#include <QLabel>
#include <QColorDialog>
#include <QSettings>
#include <QDate>
#include <QTime>

#include <shlobj.h>
#include <stdlib.h>

namespace Ui {
    class settingsDialog;
}

class settingsDialog : public QDialog {
    Q_OBJECT
public:
    settingsDialog(QWidget *parent = 0);
    ~settingsDialog();

    void setSettings();
    void getSettings();
    void getSettings( const QString& );
    void clearAll();
    int run_form( int mode = 0, const QString& name = QString() );

    bool showFullPath();
    bool displayFileExtension();
    bool attachToFilename();
    bool displayItemType();
    bool displayFileSize();
    int  displayFileSizeType();
    bool creationDate();
    bool modificationDate();
    bool lastAccessDate();
    bool fileAttributes();
    bool owner();
    bool md5Hash();

    bool rootFolderShow();
    bool fullRootPathShow();

    QString getFractionDel();
    QString getGroupSeparator();
    QString getSeparator();
    QString getDateFormat();
    QString getTimeFormat();

    QString getLastSaveFolder();
    void setLastSaveFolder( QString path );
    QString getLastReadFolder();
    void  setLastReadFolder( QString path );

    // exporting
    void exportCustomMode( const QString&, const QString& );
    bool importCustomMode( const QString&, QString );

public slots:
    void on_resetButton_clicked();

protected:
    void changeEvent(QEvent *e);

private:
    Ui::settingsDialog *m_ui;

    QString openFileName;
    QString saveFileName;
    int runMode;
    QStringList dates, dateFormats, times, timeFormats;

private slots:
    void on_rootCheck_stateChanged(int );
    void on_cancelButton_clicked();
    void on_okButton_clicked();

    void numberFormatChanged();
    void initComboBoxes();
    bool checkName( const QString& );
    void doExport( const QString&, const QString& );

    QString getSettingsFolderPath();
};

#endif // SETTINGSDIALOG_H
